<template>
  <div v-loading="isLoading">
    {{ person.name }}---{{ name }}
    <el-button @click="changeName">修改person名字</el-button>
    <div>
      <img v-for="item in dogUrl" :src="item" />
    </div>
    <el-button @click="getDog">获取一只狗</el-button>
  </div>
</template>

<script lang="ts" setup>
import { reactive, toRef } from 'vue'
import useDog from '@/hooks/useDog'

let { getDog, dogUrl, isLoading } = useDog()

let person = reactive({
  name: '张三',
  age: 18
})
let name = toRef(person, 'name')
// let { name, age } = toRefs(person)
const changeName = () => {
  name.value = name.value + '李四'
}
</script>

<style lang="scss" scoped>
img{
  height: 100px;
  border-radius: 4px;
}
</style>
